package com.boot.security.server.controller.qk;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;

/**
 *	救火商城后台登录入口 
 * @author Linxx
 *
 */

@RestController
@RequestMapping("/menu")
public class QKMenuController {
	
	private static final Logger log = LoggerFactory.getLogger("adminLogger");
	
	@GetMapping("/getlist")
	public String getlist(String p) {
		System.out.println("获取第"+p+"页菜单数据=================");
		JSONObject json = new JSONObject(true);
		json.put("state", "success");
		json.put("data",getData());
		return json.toString();
	}
	
	private List<Map<String,Object>> getData(){
		List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("id", "UUID-123123123123");
		map.put("name", "菜单管理");
		map.put("p_name", "无");
		map.put("href", "/menu");
		map.put("permission", "/sys/menu");
		map.put("type_name", "菜单");
		map.put("soft", "1");
		Map<String,Object> map1 = new HashMap<String,Object>();
		map1.put("id", "UUID-456456456456");
		map1.put("name", "订单管理");
		map1.put("p_name", "无");
		map1.put("href", "/order");
		map1.put("permission", "/sys/order");
		map1.put("type_name", "菜单");
		map1.put("soft", "1");
		list.add(map);
		list.add(map1);
		return list;
	}
}
